Xbasic

About ListTables and ListTablesWithTypes

Description

ListTables and ListTablesWithTypes are overloaded to accept a single object of type SQL::TableFilter, as opposed to having to list out a series of logical values as individual arguments.

Discussion

The SQL::TableFilter object allows you to set properties for all of the six flags that the ListTables() and ListTablesWithTypes() methods currently accept, and in addition, allows you to set properties for IncludeAllSchemas and IncludeAllOwners.

Although the prototype does not show it, the old signature still works and the autohelp shows the syntax with a note that it is now obsolete.

Example

To use the TableFilter argument, simply dimension one and override any default values as below.

dim cn as sql::connection
?cn.open("::Name::SQLServerNorthwind")
dim Filter as SQL::TableFilter
Filter.IncludeViews = .t.
Filter.IncludeSystemTables = .t.
 
?cn.listtableswithtypes(Filter)